import { createRouter, createWebHistory } from 'vue-router'


import IndexView from '../views/index/index.vue'
import ClazzView from '../views/clazz/index.vue'
import DeptView from '../views/dept/index.vue'
import EmpView from '../views/emp/index.vue'
import StuView from '../views/stu/index.vue'
import EmpReportView from '../views/report/emp/index.vue'
import StuReportView from '../views/report/stu/index.vue'
import LayoutView from '../views/layout/index.vue'
import LoginView from '../views/login/index.vue'
import PersonView from '../views/person/index.vue'
import UserView from '../views/person/user/index.vue'

const router = createRouter({   // 路由实例
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: '',
      component: LayoutView,
      redirect: '/index',  // 默认进入的页面
      children: [
        {
          path:'index',
          name: 'index',
          component: IndexView
        },
        {
          path:'clazz',
          name: 'clazz',
          component: ClazzView
        },
        {
          path:'dept',
          name: 'dept',
          component: DeptView
        },
        {
          path:'emp',
          name: 'emp',
          component: EmpView
        },
        {
          path:'stu',
          name: 'stu',
          component: StuView
        },
        {
          path:'empReport',
          name: 'empReport',
          component: EmpReportView
        },
        {
          path:'stuReport',
          name: 'stuReport',
          component: StuReportView
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: LoginView
    },
    {
      path: '/',
      name: '',
      component: PersonView,
      redirect: '/user',  // 默认进入的页面
      children: [
        {
          path:'user',
          name: 'user',
          component: UserView
        },
      ]
    }
  ]
})

export default router
